package edu.pku.dao;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;
import edu.pku.data.OutAskPrice;
import edu.pku.util.MySqlMapClient;

public class OutAskPriceDao {
	
	public void addOutAskPrice(OutAskPrice oap) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.insert("insert_out_askprice",oap);
	}
	
	public void updateOutAskPrice(OutAskPrice oap) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.update("update_out_askprice",oap);
	}
	
	public List<OutAskPrice> getOutAskPrices(String companyName) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		List<OutAskPrice> list =  sqlMap.queryForList("get_out_askprices",companyName);
		return list;
	}
	
	public void deleteOutAskPrice(OutAskPrice oap) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.delete("delete_out_askprice",oap);
	}
	
	
}
